package com.mdb.open.trade.feign;

import com.mdb.bc.api.data.ResultEx;
import com.mdb.open.common.enums.trade.type.RelationTypeEnum;
import com.mdb.open.trade.feign.dto.cus.CustAllInfoDto;
import com.mdb.open.trade.feign.dto.cus.CustAndParentCodeDto;
import com.mdb.open.trade.feign.dto.cus.CustQueryDto;
import com.mdb.open.trade.feign.dto.cus.CustomerUpdateDto;
import com.mdb.open.trade.feign.fallback.CustomerClientFallback;
import com.mdb.open.trade.feign.vo.cus.CustAllDetailVo;
import com.mdb.open.trade.feign.vo.cus.CustBaseInfoVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @description:
 * @author: you.yichao
 * @create: 2019-07-20 18:02
 **/
@FeignClient(value = "cnt-customer-service", fallbackFactory = CustomerClientFallback.class)
public interface CustomerClient {

    /**
     * 商户额度调整
     * @return
     */
    @ApiOperation("客户信息保存--直接生效")
    @PostMapping("/operate/cust_info/save_direct")
    public ResultEx<CustBaseInfoVo> saveCustInfoDirect(@RequestBody CustAllInfoDto infoDto);

    /**
     * 商户每月核额开关
     * @return
     */
    @ApiOperation("更新客户基本资料--直接生效")
    @PutMapping("/operate/cust_info/base_direct")
    public ResultEx updateCustBaseInfo(@RequestBody CustAllInfoDto infoDto);

    @ApiOperation(value = "修改客户资料，生成工单")
    @PutMapping("/operate/customer_info/generate_order")
    public ResultEx updateCustInfoGenerateOrder(@RequestBody CustomerUpdateDto customerUpdateDto);

    @ApiOperation("查询客户资料详情")
    @GetMapping("/query/cust_info_detail")
    public ResultEx<CustAllDetailVo> getCustAllInfo(CustAndParentCodeDto custAndParentCode);

    @ApiOperation("查询客户基础信息")
    @GetMapping("/query/base_info")
    public ResultEx<CustBaseInfoVo> getCustBaseInfo(CustQueryDto queryDto);

    @ApiOperation("通过大陆公司客户号查询关联客户信息")
    @GetMapping("/query/relation_customer_info/{parentCode}/{relationTypeEnum}")
    public ResultEx<CustBaseInfoVo> getRelationCustomerInfoByParentCode(@PathVariable("parentCode") String parentCode, @PathVariable("relationTypeEnum") RelationTypeEnum relationTypeEnum);
}
